package com.example.entity;

import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class Stu2 {
    private Long id;
    @NotBlank(message = "{student.name.notblank}")
    @Size(min=2,max=6,message="{name.length.error}")
    private String name;
    @DecimalMax("100")
    private double java;
    @NotNull(message = "{student.age.notnull}")
    @Min(value = 15, message = "{student.age.min}")
    @Max(value = 22, message = "{student.age.max}")
    int age;
    @NotBlank(message = "{student.gender.notblank}")
    @Pattern(regexp = "^(男|女)$", message = "{student.gender.pattern}")
    private String gender;




    public Stu2(String name, double java) {
        this.name = name;
        this.java = java;
    }
}